/**
 * @file
 * @auth jinguangguo
 * @date 2016/12/29
 */

import Vue from 'vue';
import tpl from './tpl.html';
import Loading from '../../../../../grsc-base/component/Loading.vue';
import PersonInfo from '../component/PersonInfo.vue';
import RecommendBuy from '../component/RecommendBuy.vue';
import service from '../service';
import filter from '../../../../../grsc-base/util/filter';

export default Vue.extend({
    name: 'index',
    template: tpl,
    components: {
        Loading,
        PersonInfo,
        RecommendBuy
    },
    data(){
        return {
            filter: filter,
            isLoading: true,
            detail: {},
            advertId: +this.$route.params.adId
        }
    },
    created() {
        this.isLoading = true;
        service.buyDetailQuery({
            advertId: this.advertId
        }).done((rep) => {
            let data;
            if (rep.code === window.CODE.SUCCESS) {
                this.detail = rep.data;
            }
        }).always(() => {
            this.isLoading = false;
        });
    },
    mounted(){


    },
    methods: {

    }
});
